package com.wesley.android.demo;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

/**
 * This activity is a root activity which will lead you to others.
 * 
 * @author Wesley
 */
public class RootActivity extends Activity implements OnClickListener {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);

		Button button = (Button) findViewById(R.id.btnRotate3d);
		button.setOnClickListener(this);
		button = (Button) findViewById(R.id.btnSlide);
		button.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		int id = v.getId();
		switch (id) {
		case R.id.btnRotate3d:
			startActivity(new Intent(this, Rotate3dAnimationActivity.class));
			break;
		case R.id.btnSlide:
			startActivity(new Intent(this, SlidingDrawerActivity.class));
		default:
			break;
		}
	}
}
